package com.hejjon.core.enumer;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

/**
 * 节点类型枚举
 */
@Getter
public enum LibraryNodeTypeEnum {


    CATEGORY("category", "类目"),

    FEATURE("feature", "业务特征");


    private final String name;

    private final String label;


    LibraryNodeTypeEnum(String name, String label) {
        this.name = name;
        this.label = label;
    }


    public static LibraryNodeTypeEnum getByName(String name) {
        return Arrays.stream(LibraryNodeTypeEnum.values())
                .filter(i -> StringUtils.equals(i.name, name)).findFirst().orElse(null);
    }



}
